package com.xxx.car.entity.vo.response;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.xxx.car.constants.PayChannel;
import org.apache.commons.lang3.StringUtils;

import java.util.Date;

/**
 * Created by xuwenjie on 2017/6/29.
 */
public class RespChargeGiveDetail {

    private String orderId;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date chargeDate;

    private String payChannel;

    private Long chargeAmt;

    private Long giveAmt;

    private String payChannelTitle;

    public String getOrderId() {
        return orderId;
    }

    public void setOrderId(String orderId) {
        this.orderId = orderId;
    }

    public Date getChargeDate() {
        return chargeDate;
    }

    public void setChargeDate(Date chargeDate) {
        this.chargeDate = chargeDate;
    }

    public String getPayChannel() {
        return payChannel;
    }

    public void setPayChannel(String payChannel) {
        this.payChannel = payChannel;
    }

    public Long getChargeAmt() {
        return chargeAmt;
    }

    public void setChargeAmt(Long chargeAmt) {
        this.chargeAmt = chargeAmt;
    }

    public Long getGiveAmt() {
        return giveAmt;
    }

    public void setGiveAmt(Long giveAmt) {
        this.giveAmt = giveAmt;
    }

    public String getPayChannelTitle() {
        if (StringUtils.isBlank(payChannelTitle) && StringUtils.isNotBlank(payChannel)) {
            if (payChannel.equals(PayChannel.ALIPAY)) {
                return "支付宝";
            } else if (payChannel.equals(PayChannel.WEIXIN)) {
                return "微信";
            }
        }
        return payChannelTitle;
    }

    public void setPayChannelTitle(String payChannelTitle) {
        this.payChannelTitle = payChannelTitle;
    }
}
